home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Sample.bin / AnimatorClass.java < prev    next >
Text File  |  1998-10-28  |  6KB  |  151 lines

  1. /*
  2.     A basic extension of the java.applet.Applet class
  3.  */
  4.  
  5. import java.awt.*;
  6. import java.applet.*;
  7.  
  8. import symantec.itools.multimedia.Animator;
  9. import symantec.itools.awt.Label3D;
  10. import symantec.itools.awt.VerticalSlider;
  11. import symantec.itools.multimedia.*;
  12. import symantec.itools.awt.*;
  13. public class AnimatorClass extends Applet
  14. {
  15.  
  16.     public void init()
  17.     {
  18.         // Take out this line if you don't use symantec.itools.net.RelativeURL or symantec.itools.awt.util.StatusScroller
  19.         symantec.itools.lang.Context.setApplet(this);
  20.  
  21.         // This code is automatically generated by Visual Cafe when you add
  22.         // components to the visual environment. It instantiates and initializes
  23.         // the components. To modify the code, only use code syntax that matches
  24.         // what Visual Cafe can generate, or Visual Cafe may be unable to back
  25.         // parse your Java file into its visual environment.
  26.         //{{INIT_CONTROLS
  27.         setLayout(null);
  28.         setBackground(new java.awt.Color(255,181,0));
  29.         setForeground(java.awt.Color.black);
  30.         setFont(new Font("Dialog", Font.PLAIN, 12));
  31.         setSize(528,432);
  32.         try {
  33.             animator1.setDelay(100);
  34.         }
  35.         catch(java.beans.PropertyVetoException e) { }
  36.         try {
  37.             java.net.URL[] tempURL = new java.net.URL[37];
  38.             tempURL[0] = symantec.itools.net.RelativeURL.getURL("1.GIF");
  39.             tempURL[1] = symantec.itools.net.RelativeURL.getURL("2.GIF");
  40.             tempURL[2] = symantec.itools.net.RelativeURL.getURL("3.GIF");
  41.             tempURL[3] = symantec.itools.net.RelativeURL.getURL("4.GIF");
  42.             tempURL[4] = symantec.itools.net.RelativeURL.getURL("5.GIF");
  43.             tempURL[5] = symantec.itools.net.RelativeURL.getURL("6.GIF");
  44.             tempURL[6] = symantec.itools.net.RelativeURL.getURL("7.GIF");
  45.             tempURL[7] = symantec.itools.net.RelativeURL.getURL("8.GIF");
  46.             tempURL[8] = symantec.itools.net.RelativeURL.getURL("9.GIF");
  47.             tempURL[9] = symantec.itools.net.RelativeURL.getURL("10.GIF");
  48.             tempURL[10] = symantec.itools.net.RelativeURL.getURL("11.GIF");
  49.             tempURL[11] = symantec.itools.net.RelativeURL.getURL("12.GIF");
  50.             tempURL[12] = symantec.itools.net.RelativeURL.getURL("13.GIF");
  51.             tempURL[13] = symantec.itools.net.RelativeURL.getURL("14.GIF");
  52.             tempURL[14] = symantec.itools.net.RelativeURL.getURL("15.GIF");
  53.             tempURL[15] = symantec.itools.net.RelativeURL.getURL("16.GIF");
  54.             tempURL[16] = symantec.itools.net.RelativeURL.getURL("17.GIF");
  55.             tempURL[17] = symantec.itools.net.RelativeURL.getURL("18.GIF");
  56.             tempURL[18] = symantec.itools.net.RelativeURL.getURL("19.GIF");
  57.             tempURL[19] = symantec.itools.net.RelativeURL.getURL("20.GIF");
  58.             tempURL[20] = symantec.itools.net.RelativeURL.getURL("21.GIF");
  59.             tempURL[21] = symantec.itools.net.RelativeURL.getURL("22.GIF");
  60.             tempURL[22] = symantec.itools.net.RelativeURL.getURL("23.GIF");
  61.             tempURL[23] = symantec.itools.net.RelativeURL.getURL("24.GIF");
  62.             tempURL[24] = symantec.itools.net.RelativeURL.getURL("25.GIF");
  63.             tempURL[25] = symantec.itools.net.RelativeURL.getURL("26.GIF");
  64.             tempURL[26] = symantec.itools.net.RelativeURL.getURL("27.GIF");
  65.             tempURL[27] = symantec.itools.net.RelativeURL.getURL("28.GIF");
  66.             tempURL[28] = symantec.itools.net.RelativeURL.getURL("29.GIF");
  67.             tempURL[29] = symantec.itools.net.RelativeURL.getURL("30.GIF");
  68.             tempURL[30] = symantec.itools.net.RelativeURL.getURL("31.GIF");
  69.             tempURL[31] = symantec.itools.net.RelativeURL.getURL("32.GIF");
  70.             tempURL[32] = symantec.itools.net.RelativeURL.getURL("33.GIF");
  71.             tempURL[33] = symantec.itools.net.RelativeURL.getURL("34.GIF");
  72.             tempURL[34] = symantec.itools.net.RelativeURL.getURL("35.GIF");
  73.             tempURL[35] = symantec.itools.net.RelativeURL.getURL("36.GIF");
  74.             tempURL[36] = symantec.itools.net.RelativeURL.getURL("37.GIF");
  75.             animator1.setImageList(tempURL);
  76.         }
  77.         catch (java.net.MalformedURLException error) { }
  78.         catch(java.beans.PropertyVetoException e) { }
  79.         add(animator1);
  80.         animator1.setBounds(85,332,353,70);
  81.         try {
  82.             verticalSlider1.setMaxValue(200);
  83.         }
  84.         catch(java.beans.PropertyVetoException e) { }
  85.         try {
  86.             verticalSlider1.setValue(100);
  87.         }
  88.         catch(java.beans.PropertyVetoException e) { }
  89.         try {
  90.             verticalSlider1.setTickFreq(10);
  91.         }
  92.         catch(java.beans.PropertyVetoException e) { }
  93.         add(verticalSlider1);
  94.         verticalSlider1.setBounds(5,74,535,232);
  95.         try {
  96.             label3D1.setText("Visual Cafe");
  97.         }
  98.         catch(java.beans.PropertyVetoException e) { }
  99.         try {
  100.             label3D1.setBorderIndent(symantec.itools.awt.Label3D.INDENT_TWO);
  101.         }
  102.         catch(java.beans.PropertyVetoException e) { }
  103.         add(label3D1);
  104.         label3D1.setFont(new Font("TimesRoman", Font.PLAIN, 64));
  105.         label3D1.setBounds(2,2,536,70);
  106.         //}}
  107.     
  108.         //{{REGISTER_LISTENERS
  109.         SymAction lSymAction = new SymAction();
  110.         verticalSlider1.addActionListener(lSymAction);
  111.         //}}
  112.     }
  113.  
  114.     //{{DECLARE_CONTROLS
  115.     symantec.itools.multimedia.Animator animator1 = new symantec.itools.multimedia.Animator();
  116.     symantec.itools.awt.VerticalSlider verticalSlider1 = new symantec.itools.awt.VerticalSlider();
  117.     symantec.itools.awt.Label3D label3D1 = new symantec.itools.awt.Label3D();
  118.     //}}
  119.  
  120.     
  121.  
  122.     
  123.  
  124.     class SymAction implements java.awt.event.ActionListener
  125.     {
  126.         public void actionPerformed(java.awt.event.ActionEvent event)
  127.         {
  128.             Object object = event.getSource();
  129.             if (object == verticalSlider1)
  130.                 verticalSlider1_actionPerformed(event);
  131.         }
  132.     }
  133.  
  134.     void verticalSlider1_actionPerformed(java.awt.event.ActionEvent event)
  135.     {
  136.         // to do: code goes here.
  137.              
  138.         verticalSlider1_actionPerformed_Interaction1(event);
  139.     }
  140.  
  141.  
  142.     void verticalSlider1_actionPerformed_Interaction1(java.awt.event.ActionEvent event)
  143.     {
  144.         try {
  145.             // verticalSlider1 Get the current value of the VerticalSlider
  146.             animator1.setDelay(verticalSlider1.getValue());
  147.         } catch (Exception e) {
  148.         }
  149.     }
  150.  
  151. }